<?php
/**
 * Sakam - framework oriented trough models
 * 
 * @category   	Sakam
 * @package    	Sakam_Data
 * @author		Carlos Gonzalez <zahualli@gmail.com>
 * @copyright  	Copyright (c) 2009-2010 Carlos Gonzalez
 */
class Sakam_Data_Index
{
	/**
	 * Name of index
	 * @var 	string
	 * @access 	protected
	 */
	protected $_name = null;
	
	/**
	 * Fields of index
	 * @var 	array
	 * @access	protected
	 */
	protected $_fields = array();
	
	/**
	 * Table
	 * @var 	Sakam_Data_Table_Interface
	 * @access	protected
	 */
	protected $_table = null;
	
	
	/**
	 * Constructor of class
	 * @param 	$name
	 * @access 	public
	 * @return 	void
	 */
	public function __construct( Sakam_Data_Table_Interface $table, $name )
	{
		$this->_table = $table;
		$this->_name  = $name;
	}
	
	/**
	 * Add field to index
	 * @param	Sakam_Data_Field_Interface $field
	 * @access	public
	 * @return	void
	 */
	public function addField( Sakam_Data_Field_Interface $field )
	{
		$this->_fields[] = $field;
	}
	
	/**
	 * Get SQL code
	 * @abstract
	 * @access	public
	 * @return 	void
	 */
	public abstract function getSQL();
	
	
}